package com.tao.china.common.queue;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;

import com.tao.china.common.http.porxy.PorxyEntry;


/**
 * @author liuchao
 */
public class QueueInstance {
    
    private static QueueInstance queueInstance = new QueueInstance();
    
    public static QueueInstance getInstance(){
        return queueInstance;
    }
    
    private ExecutorService searchAPIExec = Executors.newSingleThreadExecutor();
    
    private ExecutorService queueThreadExec = Executors.newSingleThreadExecutor();
    
    private ExecutorService loadUpdateExec = Executors.newSingleThreadExecutor();
    
    private  ExecutorService cacheExec = Executors.newCachedThreadPool();
    
    private BlockingQueue dataQueue        = new LinkedBlockingQueue();
    
    private BlockingQueue<PorxyEntry> porxyQueue        = new LinkedBlockingQueue<PorxyEntry>();

    public ExecutorService getSearchAPIExec() {
        return this.searchAPIExec;
    }

    public BlockingQueue getDataQueue() {
        return this.dataQueue;
    }

    public ExecutorService getCacheExec() {
        return this.cacheExec;
    }

    public ExecutorService getQueueThreadExec() {
        return this.queueThreadExec;
    }

    public ExecutorService getLoadUpdateExec() {
        return this.loadUpdateExec;
    }

    public BlockingQueue<PorxyEntry> getPorxyQueue() {
        return this.porxyQueue;
    }
    

}
